package cn.zebra.dev.member.module.member.dao;

import cn.zebra.dev.common.constant.ParamsConstant;
import cn.zebra.dev.member.module.member.entity.MemberEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 会员用户表(基础)
 *
 * @author runnable
 * @date 2019-08-29 17:33:26
 */
public interface MemberDao extends BaseMapper<MemberEntity> {

    List<MemberEntity> findIdAndMemberNameListByParentIdOfParentId(Long parentId);

    Integer addMemberExp(@Param("memberId") Long memberId, @Param("addExp") Long addExp);

    Long findTeamNumById(Long memberId);

    List<MemberEntity> queryPage(@Param(ParamsConstant.PAGE) Page page, @Param("params") Map params);

    List<MemberEntity> findIdAndMemberNameListByParentIdOfParentIdAndLevelId(@Param("parentId") Long parentId, @Param("levelId") Long levelId);

    Long findCurDateCountMember();

    Long findTotalMember();

    Long findByItemNum(Long memberId);

    MemberEntity findParentMemberByMemberId(Long memberId);
}
